package com.Deome.Class13;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Name01 {
    public static void main(String[] args) {
        HashMap<Integer,String>map=new HashMap<>();
        map.put(1,"张三");
        map.put(2,"李四");
        map.put(1,"王五");
        System.out.println(map);
        Set<Integer>integers=map.keySet();
        for (Integer integer:integers){
            String s=map.get(integer);
            System.out.println(integer+"="+s);
        }
        System.out.println();
        Set<Map.Entry<Integer,String>>entries=map.entrySet();
        for (Map.Entry<Integer,String>entry:entries){
            Integer key=entry.getKey();
            String value=entry.getValue();
            System.out.println(key+"="+value);

        }
    }
}
